
package com.tenentia.pcmps.swm.util;

import java.util.Properties;

import org.apache.log4j.Logger;

import com.tenentia.pcmps.swm.web.jsf.beans.UsersManagement;

/**
 * 
 * @author tEnEntia, S.L.N.E.
 * 
 */
public class ApplicationProperties extends Properties {

	/**
	 * Default serialVersionUID.
	 */
	private static final long serialVersionUID = 1L;

	private static final Logger LOGGER = Logger.getLogger(UsersManagement.class.getPackage().getName());

	private static ApplicationProperties staticInstance;

	private ApplicationProperties() {

		super();

		try {
			load(getClass().getClassLoader().getResourceAsStream("mediadores.properties"));
		} catch (Exception e) {
			LOGGER.error(e, e);
		}
	}

	private ApplicationProperties(Properties defaults) {

		super(defaults);

		try {
			load(getClass().getClassLoader().getResourceAsStream("mediadores.properties"));
		} catch (Exception e) {
			LOGGER.error(e, e);
		}
	}

	public static ApplicationProperties getInstance() {

		if (null == staticInstance) {
			staticInstance = new ApplicationProperties();
		}

		return staticInstance;
	}
}
